/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package group2assignone.view.manager;


import group2assignone.func.UCCtoALAdapter;
import group2assignone.ucm.manager.UCCancelAction;
import group2assignone.ucm.manager.UCConfirmAddAirport;
import group2assignone.view.OurView;
import java.awt.GridLayout;
import javax.swing.*;

/**
 *
 * @author Brad
 */
public class AddAirportView extends OurView{

    private JButton confirmButton = new JButton("Confirm");
    private JButton cancelButton = new JButton("Cancel");
    private JTextField locationField = new JTextField();
    private JTextField airTaxField = new JTextField();
    private JLabel locationLabel = new JLabel("Airport Location");
    private JLabel airTaxLabel = new JLabel("Airport Tax");
    private JLabel headingLabel = new JLabel("Enter New Airport Details");


    @Override
    public void addComponents() {

        cancelButton.addActionListener(new UCCtoALAdapter(new UCCancelAction(this)));
        confirmButton.addActionListener(new UCCtoALAdapter(new UCConfirmAddAirport(this)));

                //GridLayout(rows, cols, hgap, vgap));
        centerPanel.setLayout(new GridLayout(2, 2, 2,2));
        centerPanel.add(locationLabel);
        centerPanel.add(locationField);
        centerPanel.add(airTaxLabel);
        centerPanel.add(airTaxField);
        southPanel.add(cancelButton);
        southPanel.add(confirmButton);
        northPanel.add(headingLabel);
    }

    /**
     * @return the location entry
     */
    public String getAirportLocation() {

        return locationField.getText();
    }

    /**
     * @return the airTax entry
     */
    public String getAirTax() {
        return airTaxField.getText();
    }

}
